package org.swiftsuspenders.injectionpoints
{
	import org.swiftsuspenders.Injector;
	
	
public class PostConstructInjectionPoint extends InjectionPoint
{

	public function PostConstructInjectionPoint(node:XML, injector : Injector = null)
	{
		super(node, injector);
	}
	
	
	protected var methodName : String;
	
	protected var orderValue:int;
	
	
	public function get order():int
	{
		return orderValue;
	}

	override public function applyInjection(target : Object, injector : Injector) : Object
	{
		target[methodName]();
		return target;
	}
	
	
	override protected function initializeInjection(node : XML) : void
	{
		var orderArg : XMLList = node.arg.(@key == 'order');
		var methodNode : XML = node.parent();
		orderValue = int(orderArg.@value);
		methodName = methodNode.@name.toString();
	}
}
}